﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;
using System.Drawing;
using System.Drawing.Imaging;
namespace PTA.Image.Configuration
{
    internal class ImgZoomElement : ConfigurationElement
    {
        [ConfigurationProperty("name")]
        public string Name
        {
            get
            {
                return (string)base["name"];
            }
        }

        [ConfigurationProperty("width")]
        public int Width
        {
            get
            {
                return (int)base["width"];
            }
        }

        [ConfigurationProperty("height")]
        public int Height
        {
            get
            {
                return (int)base["height"];
            }
        }

        [ConfigurationProperty("orix", DefaultValue = 0, IsRequired = false)]
        public int OriX
        {
            get
            {
                return (int)base["orix"];
            }
        }

        [ConfigurationProperty("oriy", DefaultValue = 0, IsRequired = false)]
        public int OriY
        {
            get
            {
                return (int)base["oriy"];
            }
        }

        [ConfigurationProperty("oriwidth", DefaultValue = int.MaxValue, IsRequired = false)]
        public int OriWidth
        {
            get
            {
                return (int)base["oriwidth"];
            }
        }

        [ConfigurationProperty("oriheight", DefaultValue = int.MaxValue, IsRequired = false)]
        public int OriHeight
        {
            get
            {
                return (int)base["oriheight"];
            }
        }

        [ConfigurationProperty("zoom", IsRequired = false, DefaultValue = ZoomType.按照给定的比例缩放)]
        public ZoomType Zoom
        {
            get
            {
                return (ZoomType)base["zoom"];
            }
        }

        [ConfigurationProperty("bgcolor", IsRequired = false, DefaultValue = "Transparent")]
        public Color BgColor
        {
            get
            {
                return (Color)base["bgcolor"];
            }
        }

        public ImageFormat Format
        {
            get
            {
                return ImageFormat.Jpeg;
            }
        }

        [ConfigurationProperty("innerWidth", IsRequired = false, DefaultValue = 0)]
        public int InnerBorderWidth
        {
            get
            {
                return (int)base["innerWidth"];
            }
        }

        [ConfigurationProperty("innerColor", IsRequired = false, DefaultValue = "White")]
        public Color InnerBorderColor
        {
            get
            {
                return (Color)base["innerColor"];
            }
        }
        [ConfigurationProperty("outerWidth", IsRequired = false, DefaultValue = 0)]
        public int OuterBorderWidth
        {
            get
            {
                return (int)base["outerWidth"];
            }
        }

        [ConfigurationProperty("outerColor", IsRequired = false, DefaultValue = "White")]
        public Color OuterBorderColor
        {
            get
            {
                return (Color)base["outerColor"];
            }
        }
    }
}
